<script type="text/javascript" src="/application/echarts/echarts.min.js"></script>



<!-- 这个是图表 -->
<div id="month_price" style="height:250px;padding: 0;overflow-x:auto;overflow-y: hidden"></div>



<? $echart_month_srt="1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月";?>
<? $month_array =['01','02','03','04','05','06','07','08','09','10','11','12'];?>
<? $next_year   = date("Y", strtotime("+1 year")); ?>


<?
for($iii=0;$iii<12;$iii++)
{
    $echart_except_price[]    = sum_total($table_Prefix . "renewal",     "sum", "status = '进行中' and next_enddate like '%-" . $month_array[$iii] . "-%' ");
    $echart_price_by_except[] = sum_total($table_Prefix . "renewal_log", "sum", "status = '已审核' and next_enddate like '%".$next_year."-".$month_array[$iii] . "-%' ");
    $echart_payyet_price[]    = sum_total($table_Prefix . "renewal_log", "sum", "status = '已审核' and paydate like '%" . date("Y")."-".$month_array[$iii] . "%' ");

}

?>


<? $echart_except_price_srt=implode(",",$echart_except_price);?>
<? $echart_price_by_except_str=implode(",",$echart_price_by_except);?>
<? $echart_payyet_price_srt=implode(",",$echart_payyet_price);?>





<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var priceChart = echarts.init(document.getElementById('month_price'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: ''
        },
        tooltip: {},
        legend: {
            data: ['预计金额','预计中实收','实收时间']
        },
        xAxis: {
            data: ['<?echo $echart_month_srt?>']
        },
        yAxis: {},
        series: [

            {
                name: '预计金额',
                type: 'bar',
                color: ['#1584e5'],
                data: [<?echo $echart_except_price_srt?>]
            }
            ,
            {
                name: '预计中实收',
                type: 'bar',
                color: ['#31afa0'],
                data: [<?echo $echart_price_by_except_str?>]
            }
            ,
            {
                name: '实收时间',
                type: 'bar',
                color: ['#ff9900'],
                data: [<?echo $echart_payyet_price_srt?>]
            }

        ]
    };

    // 使用刚指定的配置项和数据显示图表。
    priceChart.setOption(option);
</script>

